#include <iostream>
#include <vector>
using namespace std;

void quickSort(vector<int>& a,int _start,int _end)
{
	if(_start<_end)
	{
		int base=a[_start];
		int left=_start,right=_end;
		while(left<right)
		{
			while(right>left && a[right]>=base)
			{
				right--;
			}
			a[left]=a[right];
			while(left<right && a[left]<base)
			{
				left++;
			}
			a[right]=a[left];
		}
		a[left]=base;
		quickSort(a,_start,left-1);
		quickSort(a,left+1,_end);

	}
}
int main()
{
	vector<int> a={10,9,8,7,6,5,4,3,2,1};
	for(auto &e:a)
	{
		cout<<e<<' ';
	}
	cout<<endl;
	quickSort(a,0,a.size()-1);
	for(auto &e:a)
	{
		cout<<e<<' ';
	}
	cout<<endl;
	return 0;
}
